<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="iso-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:template match="/">
  <xsl:apply-templates /> 
</xsl:template>

<xsl:template match="component">
	<span>
		<xsl:attribute name="id">
			<xsl:value-of select="@id"/>
		</xsl:attribute>
		<xsl:variable name="cal_id">
			<xsl:text>cal_</xsl:text><xsl:value-of select="@id"/>
		</xsl:variable>

		<div  style="position:absolute;left:5px;top:5px">
			<input type="text"
						style="vertical-align:middle; width:50px">
				<xsl:attribute name="id">
					<xsl:text>selYear_</xsl:text><xsl:value-of select="$cal_id"/>
				</xsl:attribute>
				<xsl:attribute name="onchange">
					<xsl:text>changeDate('</xsl:text><xsl:value-of select="$cal_id"/>
					<xsl:text>')</xsl:text>
				</xsl:attribute>
				<xsl:attribute name="databind">
					<xsl:text>selYear_</xsl:text><xsl:value-of select="$cal_id"/>
				</xsl:attribute>
			</input>
			<select style="vertical-align:middle">
				<xsl:attribute name="id">
					<xsl:text>selMonth_</xsl:text><xsl:value-of select="$cal_id"/>
				</xsl:attribute>
				<xsl:attribute name="onchange">
					<xsl:text>changeDate('</xsl:text><xsl:value-of select="$cal_id"/>
					<xsl:text>')</xsl:text>
				</xsl:attribute>
				<xsl:attribute name="databind">
					<xsl:text>selMonth_</xsl:text><xsl:value-of select="$cal_id"/>
				</xsl:attribute>
			<option value="1">
			Jan
			</option>
			<option value="2">
			Feb
			</option>
			<option value="3">
			Mar
			</option>
			<option value="4">
			Apr
			</option>
			<option value="5">
			May
			</option>
			<option value="6">
			Jun
			</option>
			<option value="7">
			Jul
			</option>
			<option value="8">
			Aug
			</option>
			<option value="9">
			Sep
			</option>
			<option value="10">
			Oct
			</option>
			<option value="11">
			Nov
			</option>
			<option value="12">
			Dec
			</option>
			</select>
			<select style="vertical-align:middle">
				<xsl:attribute name="id">
					<xsl:text>selDay_</xsl:text><xsl:value-of select="$cal_id"/>
				</xsl:attribute>
				<xsl:attribute name="onchange">
					<xsl:text>changeDate('</xsl:text><xsl:value-of select="$cal_id"/>
					<xsl:text>')</xsl:text>
				</xsl:attribute>
				<xsl:attribute name="databind">
					<xsl:text>selDay_</xsl:text><xsl:value-of select="$cal_id"/>
				</xsl:attribute>
			<option value="1">
			1
			</option>
			<option value="2">
			2
			</option>
			<option value="3">
			3
			</option>
			<option value="4">
			4
			</option>
			<option value="5">
			5
			</option>
			<option value="6">
			6
			</option>
			<option value="7">
			7
			</option>
			<option value="8">
			8
			</option>
			<option value="9">
			9
			</option>
			<option value="10">
			10
			</option>
			<option value="11">
			11
			</option>
			<option value="12">
			12
			</option>
			<option value="13">
			13
			</option>
			<option value="14">
			14
			</option>
			<option value="15">
			15
			</option>
			<option value="16">
			16
			</option>
			<option value="17">
			17
			</option>
			<option value="18">
			18
			</option>
			<option value="19">
			19
			</option>
			<option value="20">
			20
			</option>
			<option value="21">
			21
			</option>
			<option value="22">
			22
			</option>
			<option value="23">
			23
			</option>
			<option value="24">
			24
			</option>
			<option value="25">
			25
			</option>
			<option value="26">
			26
			</option>
			<option value="27">
			27
			</option>
			<option value="28">
			28
			</option>
			<option value="29">
			29
			</option>
			<option value="30">
			30
			</option>
			<option value="31">
			31
			</option>
			</select>
			<a href="javascript:void(null)">
				<img src="../store/other/images/pdate.gif" 
					border="0" style="vertical-align:middle;margin:5px">
					<xsl:attribute name="id">
						<xsl:text>dateLink_</xsl:text><xsl:value-of select="$cal_id"/>
					</xsl:attribute>
				</img>
			</a>
		</div>
		
		<div style="position:absolute; z-index:10; display:none">
			<xsl:attribute name="id">
				<xsl:text>container_</xsl:text><xsl:value-of select="$cal_id"/>
			</xsl:attribute>
		</div>
		<script>
		if(!SEMF.util)
		{
			SEMF["util"]= {};
		}
		<xsl:text>SEMF.util.setDate_</xsl:text><xsl:value-of select="$cal_id"/> = function() {
					
			<xsl:text>setTheDate(&quot;</xsl:text><xsl:value-of select="$cal_id"/>
			<xsl:text>&quot;);</xsl:text>
		}
		<xsl:text>initCalender(&quot;</xsl:text><xsl:value-of select="$cal_id"/>
		<xsl:text>&quot;,&quot;</xsl:text>
		<xsl:value-of select="property[@key='Apearance']/property[@key='Title']">
		</xsl:value-of>
		<xsl:text>&quot;,&quot;</xsl:text>
		<xsl:value-of select="property[@key='DataBinding']/property[@key='Year']">
		</xsl:value-of>
		<xsl:text>&quot;,&quot;</xsl:text>
		<xsl:value-of select="property[@key='DataBinding']/property[@key='Month']">
		</xsl:value-of>
		<xsl:text>&quot;,&quot;</xsl:text>
		<xsl:value-of select="property[@key='DataBinding']/property[@key='Day']">
		</xsl:value-of>
		<xsl:text>&quot;);</xsl:text>
		</script>

	</span>

</xsl:template>
</xsl:stylesheet>